head	1.5;
access;
symbols;
locks; strict;
comment	@# @;


1.5
date	2000.04.19.16.40.18;	author weston;	state Exp;
branches;
next	1.4;

1.4
date	2000.04.19.16.40.18;	author weston;	state Exp;
branches;
next	1.3;

1.3
date	2000.04.19.16.40.17;	author weston;	state Exp;
branches;
next	1.2;

1.2
date	2000.04.19.16.40.17;	author weston;	state Exp;
branches;
next	1.1;

1.1
date	2000.04.19.16.40.17;	author weston;	state Exp;
branches;
next	;


desc
@@


1.5
log
@D 1.5 94/07/25 16:48:25 weston 5 4
Fixed comments
@
text
@
To build the example Piranha programs in this directory,
do the following:

1) Make sure "clc" is in your search path.  Alternatively, edit
   Makefile to define CLC to point to the appropriate clc.

2) Edit Makefile to define PIRANHA_DIR to point to the directory
   that contains piranha.lo and piranha_sys.o.  This would normally
   be one of the lib directories in the Linda distribution.
   Alternatively, an environment variable can be used to give
   dynamic control of the Makefile, as in:

     % setenv PIRANHA_DIR /usr/licensed/sca/sun4-4.1/lib/

3) On an RS6000 or DEC alpha, edit Makefile to define LINKLIBS to
   be "-lrpcsvc".  This could be done for other platforms,
   but is unnecessary.

4) Type "make" to build the example Piranha programs.


The C-Piranha examples are:

  piranha_test.cl - A simple test program

  factor.cl - LU factorization of a matrix

  cmatrix.cl - Dense matrix multiply 


Also included is an example Piranha configuration file that documents
the default policy settings.  It must be copied to /usr/etc to be used.
See the release notes for more information.

@


1.4
log
@D 1.4 94/07/19 12:40:38 weston 4 3
Updated
@
text
@d17 1
a17 1
   be "-lX11 -lrpcsvc".  This could be done for other platforms,
@


1.3
log
@D 1.3 94/07/13 18:04:10 weston 3 2
Removed Fortran stuff
@
text
@d8 1
a8 1
2) Edit Makefile to define PIRANHA_PATH to point to the directory
d14 1
a14 1
     % setenv PIRANHA_PATH /usr/licensed/sca/sun4-4.1/lib
@


1.2
log
@D 1.2 94/07/13 17:58:18 weston 2 1
Clean up...
@
text
@a31 7
The Fortran-Piranha examples are:

  fpiranha_test.cl - A simple test program

  fmatrix.cl - Dense matrix multiply


@


1.1
log
@Initial revision
@
text
@a0 85
/*
                  - COPYRIGHT 1990, 1991, 1992, 1993 -
          Scientific Computing Associates (SCA), New Haven, CT
                          - COPYRIGHT 1989 -
                           Yale University
                         ALL RIGHTS RESERVED
*/

This directory contains a prototype of the Piranha Linda system for
use with Network Linda V2.5 only.  It contains the following files:

----------------------------------------------------------------------

piranha.cl:  The piranha interface definition.  This file must be 
	     included when building a piranha program.

piranha_test.cl:  A very simple example piranha program.

factor.cl:  A more complicated example, lu factorization.

Makefile:  Makes factor or piranha_test.

README: This file.
-----------------------------------------------------------------------

Piranha allows programs to run only on nodes that are currently
unused.  It uses three criteria to judge use: load average, keyboard
activity and pseudo-terminal activity.  Piranha will only compute on
those nodes that show no keyboard or psuedo-terminal activity for a
specified period, and that have load averages below certain limits.

Piranha programs are different from normal Linda programs in that they
do not use real_main() or eval().  Instead, the program must supply
three procedures, feeder(), piranha(), and retreat().

Feeder(argc, argv) is analogous to the master (real_main) process in
Linda.  This procedure will be invoked on the local node when piranha
starts up.  The feeder process is responsible for generating tasks and
collecting results via tuple space.  The feeder is special, in that it
always runs, i.e. never retreats.  The invocation arguments are passed
to feeder().  The piranha system will call lhalt() when feeder
returns; this is the normal termination method, although any process
may call lhalt().

Piranha() is analogous to worker processes.  The piranha function is
usually written as an infinite loop that in's tasks, computes, and
out's results.  Ntsnet will start up processes on nodes in the
nodelist as usual.  Each process (besides the master process) can
potentially begin executing a copy of piranha(); whether it does so
depends on the criteria mentioned above.  If a piranha is executing
and a node suddenly becomes busy, that piranha is said to ``retreat'',
going into a sleep state until the node becomes available again, at
which time it ``advances'', and reenters the piranha() function from
the top.

Retreat() is a special function that will be called automatically by
the piranha system when a piranha retreats.  This is typically used to
restore the current task to tuple space, so that some other piranha
can take it.

Two more functions provide the means to create a critical section
in which retreat is blocked.  task_start() enables retreat, while
task_done() disables it.  For example:

piranha()
{
...
  while (1) {
    in("task", ?curr_task);
    task_start();

    /* retreat allowed from here... */

    /* (compute here) */

    /* ...to here! */    

    task_done();
    out("result", curr_task, result);
  }
}

We recommend that only computation (no Linda operations) be done while
retreat is enabled, since it may be difficult to write the retreat
function if retreat occurs while performing Linda operations.
d2 40
@
